Skip to content

Fix subplot_of_mapper crash on interferometer data_subtracted#297

Merged
Jammy2211 merged 1 commit intomainfrom
feature/cluster-g-interferometer-pixelization-plot
May 3, 2026
Merged

Fix subplot_of_mapper crash on interferometer data_subtracted#297
Jammy2211 merged 1 commit intomainfrom
feature/cluster-g-interferometer-pixelization-plot

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

subplot_of_mapper and subplot_mappings panel 0 crashed on every interferometer pixelization fit with ValueError: not enough values to unpack (expected 2, got 1). The panels passed inversion.data_subtracted_dict[mapper] straight to plot_array, which expects a 2D array — but for interferometer fits the entry is Visibilities (1D complex).

This mirrors the existing Visibilities handling already used by panels 1-3: when the data is Visibilities, transform to a 2D dirty image via inversion.transformer.image_from(...) — the same call FitInterferometer.dirty_residual_map uses. The imaging path is untouched.

Fixes the 3 release-prep failures grouped as Cluster G + Cluster H in PyAutoBuild/test_results/runs/2026-04-29T14-48-47Z/triage.md:

  • autogalaxy_workspace/scripts/interferometer/features/pixelization/fit.py
  • autolens_workspace/scripts/interferometer/features/pixelization/fit.py
  • autolens_workspace_test/scripts/interferometer/visualization.py

API Changes

None — internal change to a plot helper. subplot_of_mapper / subplot_mappings signatures unchanged; behaviour for imaging fits is byte-identical. Interferometer fits previously crashed in panel 0; they now render a dirty data-subtracted image.

See full details below.

Test Plan

  • python scripts/interferometer/features/pixelization/fit.py (autogalaxy_workspace) — passes
  • python scripts/interferometer/features/pixelization/fit.py (autolens_workspace) — passes
  • python scripts/interferometer/visualization.py (autolens_workspace_test) — passes; rectangular + delaunay inversion subplots produced
  • python scripts/imaging/features/pixelization/fit.py (autolens_workspace) — sanity, imaging path unchanged
  • python -m pytest test_autoarray/inversion/ — 162 passed
Full API Changes (for automation & release notes)

Removed

  • None.

Added

  • None.

Changed Behaviour

  • `autoarray.inversion.plot.inversion_plots.subplot_of_mapper` panel 0 — for interferometer inversions, now renders a dirty image of the residual visibilities (via `inversion.transformer.image_from`) instead of crashing. Imaging panel 0 unchanged.
  • `autoarray.inversion.plot.inversion_plots.subplot_mappings` panel 0 — same change.

Migration

  • None required.

🤖 Generated with Claude Code

Panel 0 of `subplot_of_mapper` and `subplot_mappings` passed
`inversion.data_subtracted_dict[mapper]` directly to `plot_array`, which
expects a 2D array. For interferometer fits the entry is `Visibilities`
(1D), so `plot_array`'s `array.shape[:2]` unpack failed.

Mirror the existing `Visibilities` check in panels 1-3: when the dict
entry is `Visibilities`, transform to a 2D dirty image via
`inversion.transformer.image_from(...)` (same mechanism as
`FitInterferometer.dirty_residual_map`). Imaging path unchanged.
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label May 3, 2026
@Jammy2211
Copy link
Copy Markdown
Collaborator Author

Smoke Test Results — 2026-05-03

Workspace Passed Failed Skipped Total
autofit_workspace 6 0 1 7
autogalaxy_workspace 6 0 2 8
autolens_workspace 7 0 7 14
autolens_workspace_test 11 0 4 15
euclid_strong_lens_modeling_pipeline 0 6 0 6
HowToLens 6 0 0 6
Total 36 6 14 56

36 tests passed. 6 failures in euclid_strong_lens_modeling_pipeline — pre-existing, unrelated to this PR.

euclid_strong_lens_modeling_pipeline failures (all 6 scripts, same root cause)

All 6 euclid scripts fail with a workspace/library version mismatch that predates this PR:

autoconf.workspace.WorkspaceVersionMismatchError: Workspace version (2026.4.13.6)
at /home/jammy/Code/PyAutoLabs/euclid_strong_lens_modeling_pipeline does not match
the installed library version (2026.5.1.4).

This is a pre-existing issue with the canonical euclid_strong_lens_modeling_pipeline checkout being on an older tag. The error occurs before any PyAutoArray code is reached and is not related to the inversion_plots.py interferometer/pixelization plot change in this PR.

Affected scripts (all same error):

  • start_here.py
  • scripts/initial_lens_model.py
  • scripts/full_model.py
  • scripts/lens_model_waveband.py
  • scripts/mge_lens_only.py
  • scripts/sersic_lens_model.py

The 5 workspaces exercising the changed code path (autolens_workspace interferometer modeling, autolens_workspace_test interferometer JAX likelihood functions and aggregator) all passed cleanly.

@Jammy2211 Jammy2211 merged commit e9ea5de into main May 3, 2026
4 checks passed
@Jammy2211 Jammy2211 deleted the feature/cluster-g-interferometer-pixelization-plot branch May 3, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant